﻿using System;
using System.Linq;
using Diploma.Models.IRepositories;

namespace Diploma.Models.Repositories
{
    internal class CheckPointsRepository : ICheckPointsRepository
    {
        private readonly DiplomaEntities dataContext;

        public CheckPointsRepository(DiplomaEntities dataContext)
        {
            this.dataContext = dataContext;
        }

        public CheckPoint GetCheckPoint(Guid id)
        {
            return
                dataContext.CheckPoints.Where(chp => chp.CheckPointId == id && chp.DeletionDate == null).FirstOrDefault
                    ();
        }
    }
}